home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 …ember: Reference Library / Dev.CD Dec 94.toast / Technical Documentation / Mac Tech Notes (DocViewer) / TE • Text / TE06 International Utils / TE06 International Utils
Encoding:
Text File  |  1994-10-19  |  17.4 KB  |  21 lines  |  [ONLN/HLX2]

  1. TE 6 - Changes in International Utilities and Resources
  2. Text        
  3. Revised by:        March 1988
  4. Written by:    Priscilla Oppenheimer    July 1987
  5. The International Utilities package and the international resources have been changed with System file 4.1 to take advantage of the Script Manager.
  6. INTL vs. itl
  7. In the past, there were two INTL resources in the System file, INTL 0 and INTL 1, which contained international formatting options. Starting with System 4.1, itl0 and itl1 replace INTL 0 and INTL 1. (INTL 0 and INTL 1 are still included with the System file so that applications that do a GetResource for them will still find them. Only these erroneous applications that use GetResource will access these resources now; the System will no longer look at them.) There can now be a set of international resources (itls) for each script that is installed. That is, where once there was one resource type (INTL) with IDs 0 and 1 there are now many different resource types (itl0, itl1, itl2, itlb, itlc, KCHR) with distinct resource IDs for the various countries. The U.S. System file uses resource ID 0 for all itl resources.
  8. If your existing application calls IUGetIntl to get the appropriate international resource, you will have no problems under System 4.1. If, however, you call GetResource on INTL 0 or INTL 1 and then modify them, and expect that the System will use the modified resource, you will no longer work correctly. If your application has been released in the past with a modified System file to include your own INTL 0 and/or INTL 1, you may want to release your application with a modified itl0 and/or itl1.
  9. The International Sorting Routine 
  10. The international sorting routine is used to handle cases where letters are equal in primary ordering but different in secondary ordering (e.g., “ä” and “a”). The routine can also handle cases where one character sorts as if it were two, or two characters would sort as if they were one, or even character reversals.
  11. Prior to System 4.1, the international sorting routine was stored starting with the localRtn field of INTL 1. As of System 4.1, this routine is now stored in itl2. An INTL 2 resource is also included with the international resources, just for consistency (the System never uses it). It is exactly the same as itl2.
  12. Writing your own sorting routine can be dangerous if it is not done correctly. Before attempting to do this, we would highly recommend you check with Apple to determine if we are already doing one for the language of interest. We plan to do many international versions of System file 4.1, and most developers’ needs will be met by these. A new policy at Apple will now make it possible to license foreign versions of the System file from Software Licensing. Contact Software Licensing at (408) 973-4667 for more information about this.
  13. Error in APDA draft of Inside Macintosh Volume V 
  14. There is an error in the APDA draft of the International Utilities Package chapter of Inside Macintosh Volume V. It says that there is a flag in the Script Manager globals that overrides the current font and always uses the INTL 0 and INTL 1 resources. This is not true. INTL 0 and 1 have been replaced by itl0 and itl1, and are not used except by applications that explicitly get them by doing a GetResource. There is a relevant Script Manager flag called IntlForce that is correctly but incompletely explained in the Script Manager chapter. When IntlForce is false, the resources used by the International Utilities are determined by the current script. The script that is in use is determined by which font is in use for the port in use. For example, if you switch to the Kyoto font, then you will be using the Japanese Script Interface System (KanjiTalk). If you do this with IntlForce set to false, then you will use the resources that are associated with the Japanese Script Interface System.
  15. When IntlForce is true, the International Utilities always use the resources that are associated with the system script; this is usually Roman. IntlForce is true by default. Actually, the Script Manager initialization routine reads the itlc resource to determine what the default is, and Apple plans to release the various international System files with this field set to true in the itlc resource. Applications that want to change the value of IntlForce can use the Script Manager call SetEnvirons with the smIntlForce verb. There is a Script Manager call, IntlScript, to find out the current value.
  16. Bug in System 4.1 version of itl1
  17. There is a bug in the itl1 resource in System 4.1. The itl1 resource contains arrays of day and month names, as did the INTL 1 resource. Their formats are:
  18. days ARRAY [1..7] of STRING[15]
  19. months ARRAY[1..12] OF STRING[15]
  20. Every day and month is supposed to be coded as a Pascal string with a maximum of 15 characters, and the actual length in the first byte of the string. In System 4.0 and System 4.1, the contents of each string is always a Pascal string of length 15, with the unused characters set to nulls. In other words, the length byte is set to hex 0F. This will be fixed in a future release of the System file. If it is currently causing your application problems, you can change the lengths with ResEdit, or change them at run time, or use your own itl1 resource and release your application with an installer script. The recommended approach is to wait for a fixed version of the System file from Apple.
  21. Further Reference:
  22. •    The International Utilities
  23. •    The Script Manager
  24. *HRˇ ˇˇˇˇRH
  25. IR ¡X¡,Times
  26. .(÷Z7TE 6 - Changes in International Utilities and Resources(÷1) of 2(ÏZText†Ç
  27. /ZÅ#
  28.     0Ià:µú9"{    ˇˇˇˇˇˇˇˇ#†ƒ°d
  29. ONLNf˛†å°d1drw2…-·_ġˇˇˇˇˇè°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˙ó@†ò
  30. .R…R…(B]New Technical Notes†ô°ddrw2:°„†ó°d1drw2eÙġˇˇˇˇˇP°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˚ÄE¿†ò
  31. ({ïDeveloper Support†ô°ddrw2:°„†ó°d`drw2-ÔˇˇˇˇˇˇKÔ- Z  ffZ°d1drw2 ¿˙ÈˇˇˇˇˇˇK°ñ x°ddrw2:°ddrw2:$°d4drw2:0°öˇÙĆò
  32. 0(UÔ†ô°ddrw2:°„†ó°d1drw2ÔÊ˙ˇˇˇˇˇˇ°ñ x°ddrw2:°ddrw2:$°d4drw2:    °öˇ˝Ä†ò
  33.     +&    ®†ô°ddrw2:°„†ó°d1drw2Â-¯yˇˇˇˇˇˇ°ñ x°ddrw2:°ddrw2:$°d4drw2:°öˇ˚Ä%†ò
  34. (Z\    Macintosh†ô°ddrw2:°„†ó†ç°ddrw2D†É
  35. IR .°dONLNdçZ†∂(õZTE 6 -  °dONLNdç∂†)\&Changes in International Utilities and°dONLNd.üZ≤≠(≠Z    Resources
  36. °dONLNd8±Z¿x*Text
  37. °dONLNd?ÃZÿí* Revised by:°dONLNdLÄÿ(’„
  38. March 1988°dONLNdWÿZ‰è(·Z Written by:°dONLNdcÿ¢‰
  39. )HPriscilla Oppenheimer°dONLNdyÿ̉(·Ì    July 1987°dONLNdÉZ¸/(˘Z,The International Utilities package and the °dONLNdØ/¸)’.international resources have been changed with°dONLNdfi¸Zc(Z8System file 4.1 to take advantage of the Script Manager. X
  40. °dONLNd-Z<*4INTL,     Helvetica°dONLNd.=õ)% vs. °dONLNd -õ<™)itl
  41. °dONLNd$HZTw(QZ9In the past, there were two INTL resources in the System °dONLNd]HwT(Qwfile, INTL 0 and INTL 1, which°dONLNd|TZ`¥(]ZKcontained international formatting options. Starting with System 4.1, itl0 °dONLNd«T¥`(]¥and itl1 replace INTL°dONLNd›`Zl(iZ!0 and INTL 1. (INTL 0 and INTL 1 °dONLNd˛`l)Æ<are still included with the System file so that applications°dONLNd;lZx(uZthat do a GetResource for them °dONLNdZlx)ñ@will still find them. Only these erroneous applications that use°dONLNdõxZÑÎ(ÅZGetResource will access these °dONLNdπxÎÑ)ë=resources now; the System will no longer look at them.) There°dONLNd˜ÑZêO(çZ7can now be a set of international resources (itls) for °dONLNd.ÑOê)ı-each script that is installed. That is, where°dONLNd\êZú•(ôZ?once there was one resource type (INTL) with IDs 0 and 1 there °dONLNdõê•ú(ô•are now many different°dONLNd≤úZ®å(•ZBresource types (itl0, itl1, itl2, itlb, itlc, KCHR) with distinct °dONLNdÙúå®(•åresource IDs for the various°dONLNd®Z¥´(±ZIcountries. The U.S. System file uses resource ID 0 for all itl resources.°dONLNd[¿ZÃ˘*#If your existing application calls °dONLNd~¿˘Ã)ü<IUGetIntl to get the appropriate international resource, you°dONLNdªÃZÿ(’Z9will have no problems under System 4.1. If, however, you °dONLNdÙÃÿ(’call GetResource on INTL 0 or°dONLNdÿZ‰I(·Z1INTL 1 and then modify them, and expect that the °dONLNdCÿI‰)Ô*System will use the modified resource, you°dONLNdn‰Zö(ÌZEwill no longer work correctly. If your application has been released °dONLNd≥‰ö(Ìöin the past with a modified°dONLNdœZ¸(˘Z System file to include your own °dONLNdÔ¸)¶2INTL 0 and/or INTL 1, you may want to release your°dONLNd"¸Z#(Z-application with a modified itl0 and/or itl1.
  42. °dONLNdP Z/<*'!The International Sorting Routine
  43. °dONLNds;ZGË*RThe international sorting routine is used to handle cases where letters are equal °dONLNd≈;ËG(DË
  44. in primary°dONLNd–GZS™(PZFordering but different in secondary ordering (e.g., “ä” and “a”). The °dONLNdG™S(P™routine can also handle°dONLNd.SZ_+(\Z.cases where one character sorts as if it were °dONLNd\S+_)—1two, or two characters would sort as if they were°dONLNdé_ZkÛ(hZ!one, or even character reversals.°dONLNd∞wZÉä*BPrior to System 4.1, the international sorting routine was stored °dONLNdÚwäÉ(Ää starting with the localRtn field°dONLNdÉZèg(åZof °dONLNdÉgè)
  45. XINTL 1. As of System 4.1, this routine is now stored in itl2. An INTL 2 resource is also°dONLNdoèZõÆ(òZincluded with the °dONLNdÅèÆõ)TOinternational resources, just for consistency (the System never uses it). It is°dONLNd—õZß (§Zexactly the same as itl2.ˇ°¿Ù%%DSIDICT:_cv
  46. currentdict /bu known {bu}if
  47. userdict /_cv known not{userdict /_cv 30 dict put}if
  48. _cv begin
  49. /bdf{bind def}bind def
  50. currentscreen/cs exch def/ca exch def/cf exch def
  51. /setcmykcolor where{/setcmykcolor get /cvcmyk exch def}{/cvcmyk{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdf }ifelse
  52. /ss{//cf //ca //cs setscreen}bdf
  53. /stg{ss setgray}bdf
  54. /strgb{ss setrgbcolor}bdf
  55. /stcmyk{ss cvcmyk}bdf
  56. /min1{dup 0 eq{pop 1}if}bdf
  57. end
  58. currentdict /bn known {bn}if
  59. †ø0HRˇ ˇˇˇˇRH
  60. IR,Times
  61. .+6-Macintosh Technical Notes /4/˘ ¡4¡˘(÷62) of 2)fl7TE 6 - Changes in International Utilities and Resources+ÃText
  62. °dONLNd<6HÂ(E6!Writing your own sorting routine °dONLNd!<ÂH¯)Ø4can be dangerous if it is not done correctly. Before°dONLNdVH6TÍ(Q6Vattempting to do this, we would highly recommend you check with Apple to determine if °dONLNd¨HÍT¯(QÍwe°dONLNdØT6`¬(]6Uare already doing one for the language of interest. We plan to do many international °dONLNdT¬`¯(]¬ versions of°dONLNd`6l (i6,System file 4.1, and most developers’ needs °dONLNd<` l¯)’0will be met by these. A new policy at Apple will°dONLNdml6xj(u6    now make °dONLNdvljx¯)4Sit possible to license foreign versions of the System file from Software Licensing.°dONLNd x6Ñ≠(Å6MContact Software Licensing at (408) 973-4667 for more information about this.
  63. °dONLNdú6´î*'0Error in APDA draft of Inside Macintosh Volume V
  64. °dONLNdJ∑6√a*    There is °dONLNdS∑a√€)+Man error in the APDA draft of the International Utilities Package chapter of °dONLNd†∑€√¯(¿€Inside°dONLNdß√6œö(Ã6Macintosh Volume V°dONLNdπ√öœ∫)dB. It says that there is a flag in the Script Manager globals that °dONLNd˚√∫œ¯(Ã∫
  65. overrides the°dONLNd    œ6€”(ÿ6Ucurrent font and always uses the INTL 0 and INTL 1 resources. This is not true. INTL °dONLNd^œ”€¯(ÿ”0 and 1°dONLNdf€6ÁÍ(‰6]have been replaced by itl0 and itl1, and are not used except by applications that explicitly °dONLNd√€ÍÁ¯(‰Íget°dONLNd«Á6ÛP(6them °dONLNdÃÁPÛ¯)Xby doing a GetResource. There is a relevant Script Manager flag called IntlForce that is°dONLNd%Û6ˇÃ(¸6Vcorrectly but incompletely explained in the Script Manager chapter. When IntlForce is °dONLNd{ÛÃˇ¯(¸Ã
  66. false, the°dONLNdܡ6 ë(6Lresources used by the International Utilities are determined by the current °dONLNd“ˇë ¯(ëscript. The script that°dONLNdÍ 6Ô(6`is in use is determined by which font is in use for the port in use. For example, if you switch °dONLNdJ Ô¯(Ôto°dONLNdM6#Ê( 6\the Kyoto font, then you will be using the Japanese Script Interface System (KanjiTalk). If °dONLNd©Ê#¯( Êyou°dONLNd≠#6/ü(,6do this with IntlForce °dONLNdƒ#ü/¯)iJset to false, then you will use the resources that are associated with the°dONLNd/6;’(86!Japanese Script Interface System.°dONLNd1G6S»*VWhen IntlForce is true, the International Utilities always use the resources that are °dONLNdáG»S¯(P»
  67. associated°dONLNdíS6_¬(\6 with the system script; this is °dONLNd≤S¬_¯)åAusually Roman. IntlForce is true by default. Actually, the Script°dONLNdÙ_6kì(h6MManager initialization routine reads the itlc resource to determine what the °dONLNdA_ìk¯(hìdefault is, and Apple°dONLNdWk6wr(t6Bplans to release the various international System files with this °dONLNdôkrw¯(trfield set to true in the itlc°dONLNd∑w6Éõ(Ä6Jresource. Applications that want to change the value of IntlForce can use °dONLNdwõɯ(Äõthe Script Manager°dONLNdÉ6èÜ(å6call SetEnvirons °dONLNd%ÉÜè¯)PNwith the smIntlForce verb. There is a Script Manager call, IntlScript, to find°dONLNdtè6õö(ò6out the current value.
  68. °dONLNdã≥6¬*'!Bug in System 4.1 version of itl1
  69. °dONLNd≠Œ6⁄´*There is a bug in the itl1 °dONLNd»Œ´⁄¯)uDresource in System 4.1. The itl1 resource contains arrays of day and°dONLNd    
  70. ⁄6ÊV(„6;month names, as did the INTL 1 resource. Their formats are:,
  71. Courier
  72.     °dONLNd    IÚ6˝—*days ARRAY [1..7] of STRING[15]°dONLNd    i¸6€*
  73. !months ARRAY[1..12] OF STRING[15]
  74. °dONLNd    ã6`*8Every day and month is supposed to be coded as a Pascal °dONLNd    √`¯(`string with a maximum of 15°dONLNd    fl6*€('6%characters, and the actual length in °dONLNd
  75. €*¯)•;the first byte of the string. In System 4.0 and System 4.1,°dONLNd
  76. @*66∏(36Tthe contents of each string is always a Pascal string of length 15, with the unused °dONLNd
  77. î*∏6¯(3∏characters set°dONLNd
  78. £66B(?6-to nulls. In other words, the length byte is °dONLNd
  79. –6B¯) 5set to hex 0F. This will be fixed in a future release°dONLNd B6N†(K6of the System file. If °dONLNd B†N¯)jEit is currently causing your application problems, you can change the°dONLNd cN6ZÅ(W6Blengths with ResEdit, or change them at run time, or use your own °dONLNd •NÅZ¯(WÅitl1 resource and release°dONLNd øZ6f’(c6Syour application with an installer script. The recommended approach is to wait for °dONLNd Z’f¯(c’a fixed°dONLNd f6rÏ(o6&version of the System file from Apple.°dONLNd Aä6ñ†*$Further Reference: ñ4ñ˘°dONLNd TóH£L+
  80. •°dONLNd VóZ£“)The International Utilities°dONLNd r£HØL(¨H•°dONLNd t£ZØ∑)The Script Managerˇ